<?php

namespace common\entities\myhtsq;

use Yii;

/**
 * This is the model class for table "myscrm_payment_achievement".
 *
 * @property string $achievement_id
 * @property string $contract_id
 * @property string $receivable_item_id
 * @property string $money_category_item_id
 * @property string $achievement_amount
 * @property string $belong_by
 * @property string $abu_by
 * @property string $department_by
 * @property string $area_by
 * @property string $manager_by
 * @property string $invoice_payment_id
 * @property string $created_on
 * @property string $created_by
 * @property string $modified_on
 * @property string $modified_by
 * @property string $received_time
 * @property string $achievement_belong_time
 * @property string $erp_achievement_belong_bu
 * @property string $erp_achievement_belong
 * @property string $erp_achievement_belong_abu
 * @property string $erp_achievement_belong_abu_owner
 * @property string $erp_achievement_belong_bu_manager
 */
class PaymentAchievementEntity extends \common\entities\ConfigEntity {

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return 'myscrm_payment_achievement';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['achievement_id', 'receivable_item_id'], 'required'],
            [['achievement_amount'], 'number'],
            [['created_on', 'modified_on', 'received_time', 'achievement_belong_time'], 'safe'],
            [['achievement_id', 'contract_id', 'receivable_item_id', 'money_category_item_id', 'belong_by', 'abu_by', 'department_by', 'area_by', 'manager_by', 'created_by', 'modified_by', 'invoice_payment_id', 'payment_id','erp_achievement_belong_bu', 'erp_achievement_belong', 'erp_achievement_belong_abu', 'erp_achievement_belong_abu_owner', 'erp_achievement_belong_bu_manager'], 'string', 'max' => 36]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'achievement_id' => '业绩ID',
            'contract_id' => '合同ID',
            'receivable_item_id' => '应收款项ID',
            'money_category_item_id' => '款项小类别ID',
            'achievement_amount' => '回款业绩金额',
            'belong_by' => '业绩归属人ID',
            'abu_by' => '业绩归属ABU',
            'department_by' => '业绩归属部门',
            'area_by' => '业绩归属区域',
            'manager_by' => 'ERP客户经理',
            'invoice_payment_id' => '回款与发票及应收款对应关系ID',
            'payment_id' => '回款ID',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'modified_on' => '修改时间',
            'modified_by' => '修改人',
            'received_time' => '实收时间（=回款实际到帐时间）',
            'achievement_belong_time' => '业绩归属时间(默认等于实收时间，可调整)',
            'erp_achievement_belong_bu' => 'ERP客户经理所属部门',
            'erp_achievement_belong' => 'ERP业绩归属人',
            'erp_achievement_belong_abu' => 'ERP业绩归属ABU（由ERP业绩归属人带出）',
            'erp_achievement_belong_abu_owner' => 'ERP业绩归属ABU负责人',
            'erp_achievement_belong_bu_manager' => 'ERP业绩归属部门经理',
        ];
    }

}
